#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
struct student
{
    int nume;
    char name[20];
    int score;
};
struct student stu[10];
int main(void)
{
    int i, N, sum = 0;
    scanf("%d", &N);
    for (i = 0; i < N; i++)
    {
        scanf("%d%s%d", &stu[i].nume, &stu[i].name, &stu[i].score);
        sum += stu[i].score;
    }
    printf("%.2d\n", sum / N);
    for (i = 0; i < N; i++)
    {
        if (stu[i].score< sum / N)
        {
            printf("%s %d\n", stu[i].nume, stu[i].name);
        }
    }
    return 0;
}